const os = require('os')
const axios = require('axios')

module.exports = {
    getIpv4() {
        const interface_list = os.networkInterfaces()
        for (let interface_name in interface_list) {
            for (let conn_info of interface_list[interface_name]) {
                if (conn_info.address != '127.0.0.1' && conn_info.family == 'IPv4') {
                    return conn_info.address
                }
            }
        }

        return undefined
    }
}